<!DOCTYPE html>
<html lang="en">
<head>
    <title>Title</title>
    <!--共有部分-start-->
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <link rel="stylesheet" href="static/css/common.css">
    <script src="static/js/config.js"></script>
    <script src="static/lib/jquery.min.js"></script>
    <!--共有部分-end-->

    <link rel="stylesheet" href="static/fonts/css/font-awesome.css">
    <link rel="stylesheet" href="static/fonts/kdfonts/kdfont-awesome.css">
    <script src="static/UEditor/ueditor.config.js"></script>
    <script src="static/UEditor/ueditor.all.js"></script>
    <script src="static/UEditor/lang/zh-cn/zh-cn.js"></script>
    <link rel="stylesheet" href="static/UEditor/themes/default/css/ueditor-more.css">

    <link rel="stylesheet" href="static/css/home.css">
</head>
<body>
<!--公用导航-start-->
<div class="header">
    <div class="inner">
        <div class="logo">
            <a href=""></a>
        </div>
        <div class="info">
            <span class="date">2017年10月10日</span>&nbsp;&nbsp;<span class="day"></span>&nbsp;&nbsp;|&nbsp;&nbsp;报料人&nbsp;&nbsp;<span class="informer">1212</span>&nbsp;位&nbsp;&nbsp;当前在线<span class="online">123123</span>人
        </div>
        <div class="user">
            <a href=""><span class="icon-user"></span><em>登录</em></a>
            <a href=""><span class="icon-search"></span><em>查找</em></a>
        </div>
    </div>
</div>
<div class="nav">
    <div class="inner">
        <ul>
            <li><a href="">首页</a></li>
            <li><a href="">最新</a></li>
            <li><a href="">热门</a></li>
            <li><a href="">报料反馈</a></li>
            <li><a href="">红黑榜</a></li>
            <li class="act"><a href="">附件报料</a></li>
        </ul>
        <a class="write" href="">
            <span class="icon-write"></span>
            <em>我要报料</em>
        </a>
    </div>
</div>
<!--公用导航-end-->

<div class="publish">
    <!--标题-->
    <div class="editor-title">
        <input class="publish-tit" type="text" placeholder="请输入标题" maxlength="30">
    </div>
    <!--编辑框-->
    <div class="editor-cont">
        <script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
    </div>
    <!--联系电话-->
    <div class="phone">
        <input class="publish-tit" type="text" placeholder="请输入联系电话。（事件跟进联系用，不公开。）" maxlength="30">
    </div>
    <!--地址-->
    <div class="address">
        <i class="icon-map"></i>
        此料发生地：广东省广州市越秀区解放北路588号 <a href="javascript:;">修改</a>
    </div>
    <!--提交-->
    <button type="button" class="submit">提交</button>
</div>

<script>
    $(function () {
        //初始化编辑器
        var isEdit = false,isatData = true,c_json,defaultTxt = '<span class="default-txt">请输入正文</span>',
            ue = UE.getEditor('editor',{
                toolbars: [
                    ['emotion','insertimage','insertvideo','paragraph','bold','underline','italic','forecolor','link','insertorderedlist','insertunorderedlist','justifyleft','justifycenter','justifyright','blockquote','horizontal','indent'/*'autotypeset','fullscreen'*/]
                ],
                insertorderedlist : {
                    'decimal': '1,2,3...' ,
                },
                insertunorderedlist : {
                    'disc': '● 小圆点',
                },
                paragraph : {
                    'p': '正文',
                    'h2': '标题一',
                    'h3': '标题二',
                },
                initialContent:defaultTxt,
                autoClearinitialContent:true,
                wordCountMsg : '8000字以内，您已写 <span>{#count}</span> 个字',
                enableContextMenu : false,  //右键菜单
                elementPathEnabled : false, //元素路径
                enableAutoSave:false, //是否启用自动保存
                //pasteplain:true,
                saveInterval:1000000000,
                autotypeset:{
                    mergeEmptyline: true, //合并空行
                    removeClass: true, //去掉冗余的class
                    removeEmptyline: true, //去掉空行
                    removeEmptyNode: true, // 去掉空节点
                    //可以去掉的标签
                    removeTagNames: {},
                    indent: true, // 行首缩进
                    indentValue: '4', //行首缩进的空格数
                    bdc2sb: false,
                    tobdc: false
                },
                filterRules: function(){
                    function transP(node) {
                        node.tagName = 'p';
                        delete node.attrs;
                    }
                    return {
                        '-' : 'script style object iframe embed input select',
                        'p': {$:{}},
                        'img':{$:{'src':1}},
                        'a':{'$':{'href':1}},
                        'ol':{$:{}},
                        'ul':{$:{}},
                        'li':{$:{}},
                        'strong':{$:{}},
                        'b':{$:{}},
                        'br':{$:{}},
                        'blockquote':{$:{}},
                        'div':transP,
                        'caption':transP,
                        'th':transP,
                        'tr':transP,
                        'h1':transP,
                        'h2':transP,
                        'h3':transP,
                        'h4':transP,
                        'h5':transP,
                        'h6':transP,
                        'td':function(node) {
                            var txt = !!node.innerText();
                            if(txt)
                            {
                                node.parentNode.insertAfter(UE.uNode.createText(' &nbsp; &nbsp;'),node);
                            }
                            node.parentNode.removeChild(node,node.innerText())
                        }
                    }
                }()
            });

        ue.addListener('ready', function(editor){
            //$(this.document.body).atwho({
            //    at: "@",
            //    data: c_json,
            //    limit: 20,
            //    searchKey: "value",
            //    displayTpl : '<li class="userface"><div class="avatar a-w32"><img src=${data} /></div>${value}</li>',
            //    insertTpl : '${atwho-at}${value}',
            //});
            console.log(0)
            //插入图形
            $('#edui3 .edui-icon').html('<i class="fa fa-smile-o"></i>');
            $('#edui11 .edui-icon').html('<i class="fa kd-image"></i>');
            $('#edui16 .edui-icon').html('<i class="fa kd-video-camera"></i>');
            $('#edui22 .edui-icon').html('<i class="fa fa-bold"></i>');
            $('#edui23 .edui-icon').html('<i class="fa fa-underline"></i>');
            $('#edui24 .edui-icon').html('<i class="fa fa-italic"></i>');
            $('#edui25 .edui-icon').html('<i class="fa fa-font"></i>');
            $('#edui32 .edui-icon').html('<i class="fa kd-link"></i>');
            $('#edui33 .edui-icon').html('<i class="fa fa-list-ol"></i>');
            $('#edui36 .edui-icon').html('<i class="fa fa-list-ul"></i>');
            $('#edui39 .edui-icon').html('<i class="fa fa-align-left"></i>');
            $('#edui40 .edui-icon').html('<i class="fa fa-align-center"></i>');
            $('#edui41 .edui-icon').html('<i class="fa fa-align-right"></i>');
            $('#edui42 .edui-icon').html('<i class="fa fa-quote-left"></i>');
            $('#edui43 .edui-icon').html('<i class="fa fa-ellipsis-h"></i>');
            $('#edui44 .edui-icon').html('<i class="fa fa-outdent"></i>');
            //$('#edui47 .edui-icon').html('<i class="fa fa-expand"></i>');
            //插入下拉按钮
            $('#edui17 .edui-arrow,#edui25 .edui-arrow').html('<i class="fa fa-caret-down"></i>');
            //去除下拉标
            $('#edui3 .edui-arrow,#edui33 .edui-arrow,#edui36 .edui-arrow,#edui44 .edui-arrow').remove();
            //添加发布按钮
            $('.cg-writing-nav .box').append('<buttom class="publish-btn">发表</buttom>');
        });
    })
</script>

</body>
</html>